<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="static/css/a.css">
    <script src="static/js/jquery-3.7.1.js"></script>
</head>
<body>
<div class="test">
    <h1>测试动静分离</h1>
    <img src="static/img/1.jpg">

    <p><button id="btn">点我查询数据</button></p>
    <div id="content"></div>
</div>
</body>
<script type="text/javascript">
    $("#btn").click(function(){
        $.ajax({
            type: "GET",
            url: "/java_test.jsp",
            success: function (data) {
                $("#content").html(data)
            },
            error: function (xhr, status, error) {
                $("#content").html("动态请求失败,需要检查你服务: "+error);
            }
        });
    })
</script>
</html>
